package com.suotuo.common.util;

import lombok.Data;

/**
 * @author liulubingjava@163.com
 * @data 2019/1/18 17:51
 */
@Data
public class Result<T> {
    private Integer code;
    private String msg;
    private T data;

    private Result(T data){
        this.code = 0;
        this.msg = "ok";
        this.data = data;
    }
    private Result(){
        this.code = 1;
        this.msg = "error";
    }
    public static Result success(Object data){
        return new Result(data);
    }
    public static Result error(){
        return  new Result();
    }
}
